package com.zzz.share.common.core.context;

/**
 * @BelongsProject: share
 * @BelongsPackage: com.zzz.share.common.core.context
 * @Author: zwq
 * @CreateTime: 2025-05-29  20:38
 * @Description: 用户上下文
 * @Version: 1.0
 */
public class UserContext {
    private static final ThreadLocal<String> userId = new ThreadLocal<>();

    public static String getUserId() {
        return userId.get();
    }

    public static void setUserId(String userId) {
        UserContext.userId.set(userId);
    }

    public static void clear() {
        userId.remove();
    }
}
